/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import java.io.*;
import java.util.*;
import java.sql.*;

public class MakeDefaultFormBean {

    public String accid;
    public Hashtable errors;
    public DbConnect dbc;

    public String getErrorMsg(String s) {
        String errorMsg = (String) errors.get(s.trim());
        return (errorMsg == null) ? "" : errorMsg;
    }

    public MakeDefaultFormBean() {
    }

    public void setSelect1(String[] item) {
        accid = item[0];
    }

    public boolean match() {
        boolean flag = true;
        Connection con = null;
dbc=new DbConnect();

        try {

            con = dbc.getOracleConnection();
            Statement st = con.createStatement();


            st.executeUpdate("update onbill_account set defstatus=0 where custid=1001");
            st.executeUpdate("update onbill_account set defstatus=1 where accno=" + accid);

            st.executeUpdate("commit");




        } catch (Exception e) {
            e.printStackTrace();
        }

        return flag;
    }
}
